From d2540893086c46bad4c12071d31dfe86750949fe Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 27 Jan 2011 13:09:56 -0500 Subject: [PATCH] mount-operation: don't show the dialog until the tree is populated Otherwise it won't show up properly, and GTK+ will trigger a warning. Don't know why this did not show up before. https://bugzilla.gnome.org/show_bug.cgi?id=640744 --- gtk/gtkmountoperation.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c index 2cdd1d594b..ffa6656866 100644 --- a/gtk/gtkmountoperation.c +++ b/gtk/gtkmountoperation.c @@ -1182,7 +1182,7 @@ on_button_press_event_for_process_tree_view (GtkWidget *widget, return ret; } -static void +static GtkWidget * create_show_processes_dialog (GMountOperation *op, const char *message, const char *choices[]) @@ -1309,9 +1309,9 @@ create_show_processes_dialog (GMountOperation *op, g_object_add_weak_pointer (G_OBJECT (tree_view), (gpointer *) &priv->process_tree_view); g_object_unref (list_store); - - gtk_widget_show_all (dialog); g_object_ref (op); + + return dialog; } static void @@ -1321,6 +1321,7 @@ gtk_mount_operation_show_processes (GMountOperation *op, const char *choices[]) { GtkMountOperationPrivate *priv; + GtkWidget *dialog = NULL; g_return_if_fail (GTK_IS_MOUNT_OPERATION (op)); g_return_if_fail (message != NULL); @@ -1332,7 +1333,7 @@ gtk_mount_operation_show_processes (GMountOperation *op, if (priv->process_list_store == NULL) { /* need to create the dialog */ - create_show_processes_dialog (op, message, choices); + dialog = create_show_processes_dialog (op, message, choices); } /* otherwise, we're showing the dialog, assume messages+choices hasn't changed */ @@ -1340,6 +1341,11 @@ gtk_mount_operation_show_processes (GMountOperation *op, update_process_list_store (GTK_MOUNT_OPERATION (op), priv->process_list_store, processes); + + if (dialog != NULL) + { + gtk_widget_show_all (dialog); + } } static void -- 2.30.2